import time
from socket import *
import os

tcp_client_socket = socket(AF_INET, SOCK_STREAM)
tcp_client_socket.settimeout(None)
connected = False
while True:
    if not connected:
        try:
            tcp_client_socket.connect(("10.0.0.1", 8890))
            connected = True
            break
        except:
            pass
try:
    msg = bytearray(100*5000)
    s = time.time()
    for i in range(1):
        tcp_client_socket.send(msg)

    d = time.time() - s

    print d
except:
    with open('err.out', 'a+') as f:
        f.write('err\n')
